# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=windows-prefetch-parser
pkgver=88.bc1fa58
pkgrel=6
pkgdesc='Parse Windows Prefetch files.'
groups=('blackarch' 'blackarch-forensic')
arch=('any')
url='https://github.com/PoorBillionaire/Windows-Prefetch-Parser'
license=('Apache')
depends=('python')
makedepends=('git' 'python-setuptools')
source=("$pkgname::git+https://github.com/PoorBillionaire/Windows-Prefetch-Parser.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}


build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.rst
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  mv "$pkgdir/usr/bin/prefetch.py" "$pkgdir/usr/bin/prefetch"
}

